﻿#include <bits/stdc++.h>
using namespace std;

const int N = 1e6 + 10;
int n, m;
vector<vector<int>> edges(N); // edges[i] 表⽰ i 这个点所连接的边的信息
queue<int> q;
int in[N];//统计入度信息
vector<int> ret;
int main()
{
    cin >> n >> m;
    while (m--)
    {
        int a, b;
        cin >> a >> b;
        edges[a].push_back(b);//存储边的信息
        in[b]++;//存储入度
    }

    for (int i = 1; i <= n; i++)
    {
        if (in[i] == 0)
        {
            q.push(i);
        }
    }

    while (q.size())
    {
        auto a = q.front();
        q.pop();
        ret.push_back(a);

        for (auto b : edges[a])
        {
            if (--in[b] == 0)
            {
                q.push(b);
            }
        }
    }

    if (ret.size() == n)
    {
        for (int i = 0; i < n - 1; i++)
        {
            cout << ret[i] << " ";
        }
        cout << ret[n - 1];
    }
    else
    {
        cout << "-1" << endl;
    }















}